Multi-method evaluation of a 2-(1,3,4-thiadiazole-2-yl)pyrrolidine corrosion inhibitor for mild steel in HCl: combining gravimetric, electrochemical, and DFT approaches

The corrosion inhibition properties of 2-(1,3,4-thiadiazole-2-yl)pyrrolidine (2-TP) on mild steel in a 1 M HCl solution were investigated using weight loss, potentiodynamic polarization, electrochemical impedance spectroscopy (EIS) and open circuit potential (OCP) measurements. In addition, DFT calculations were performed on 2-TP. The polarization curves revealed that 2-TP is a mixed-type inhibitor. The results indicate that 2-TP is an effective inhibitor for mild steel corrosion in a 1.0 M HCl solution, with an inhibition efficiency of 94.6% at 0.5 mM 2-TP. The study also examined the impact of temperature, revealing that the inhibition efficiency increases with an increasing concentration of 2-TP and decreases with a rise in temperature. The adsorption of the inhibitor on the mild steel surface followed the Langmuir adsorption isotherm, and the free energy value indicated that the adsorption of 2-TP is a spontaneous process that involves both physical and chemical adsorption mechanisms. The DFT calculations showed that the adsorption of 2-TP on the mild steel surface is mainly through the interaction of the lone pair of electrons on the nitrogen atom of the thiadiazole ring with the metal surface. The results obtained from the weight loss, potentiodynamic polarization, EIS and OCP measurements were in good agreement with each other and confirmed the effectiveness of 2-TP as a corrosion inhibitor for mild steel in 1.0 M HCl solution. Overall, the study demonstrates the potential use of 2-TP as a corrosion inhibitor in acid environments.

Thiadiazoles are a class of organic compounds with the formula (C 2 H 2 NH) 2 CS. They are heterocyclic compounds containing two nitrogen atoms and a sulfur atom in a ring system 1 . Thiadiazoles have various applications, including as fungicides, herbicides, insecticides, anti-inflammatory agents, and intermediate compounds in drug synthesis and the development of novel materials 2 . Some well-known thiadiazoles are metconazole and fenbuconazole. Our observations have led us to study the corrosion inhibition properties of 2-(1,3,4-thiadiazole-2-yl)pyrrolidine (2-TP). 2-TP was chosen as a corrosion inhibitor due to its heterocyclic structure, which includes a pyrrolidine functional group, three nitrogen atoms, and one sulfur atom in the ring. Its π electrons allow it to easily bond to mild steel (MS), reducing corrosion. It is commercially available or can be synthesized using green chemistry, resulting in a good yield. The mechanism of action of thiadiazoles as corrosion inhibitors is based on their ability to adsorb onto the metal surface and form a protective film. This film acts as a physical barrier, preventing corrosive species from reaching the metal surface and thus inhibiting the corrosion process. The adsorption process is influenced by factors such as the concentration of the inhibitor, pH, temperature, and the nature of the metal surface 3,4 . Mild steel is versatile and affordable, making it a popular choice for various industries 5,6 . It has low carbon content, making it easy to shape and weld, and its durability makes it ideal for construction and machinery [7][8][9][10] . Mild steel is also relatively cheap compared to other steels. Pickling is a metal  DFT computations. In this study, quantum chemical calculations were performed using Gaussian 03 Revision C.01. The ground-state geometry was calculated with the 6-31G++ (d,p) valence and polarization basis set, and the optimization was done without symmetry constraints to reach a local minimum. The calculations were performed using the B3LYP approach, which combines the Becke three-parameter hybrid exchange functional with the Lee-Yang-Parr correlation functional 37 . The optimized geometry, HOMO and LUMO energies, and other physical parameters of the molecule were evaluated using this method. According to DFT-Koopman's theorem, the ionization potential is related to the HOMO energy (EHOMO), while the electron affinity is related to the LUMO energy (ELUMO). These values can be calculated using Eqs. 4 and 5 38 .
The examination of the Natural Bond Orbital (NBO) was performed to assess the distribution of electron densities, as electron density plays a crucial role in determining the parameters of chemical reactivity. The electronegativity (χ), hardness (η), and softness (σ) were calculated using Eqs. 6-8 39 .
The number of transferred electrons (ΔN) was calculated using a DFT approach using Eq. 9.
This equation considers the absolute electronegativity of iron ( χ Fe ), which was found to be 7.0 eV, and the absolute electronegativity of the inhibitor molecule ( χ inh ). It also takes into account the absolute hardness of (1) C R mg cm −2 h −1 = W at www.nature.com/scientificreports/ iron ( η Fe ), which was found to be zero, and the absolute hardness of the inhibitor molecule ( η inh ). So, Eq. 9 can be converted to Eq. 10 40 .

Results and discussion
Weight loss. Effect of the inhibitor concentration. The protection of mild steel from corrosion was achieved using 2-TP, as shown in Fig. 2. The rate of corrosion (C R ) and inhibition efficiency (IE%) were measured through weight loss tests at 303 K. The results showed that with an increase in 2-TP concentration, the CR decreased, resulting in improved inhibition due to the adsorption of more 2-TP molecules onto the mild steel, reducing its interaction with HCl. The highest inhibition efficiency of 94.6% was achieved at a 2-TP concentration of 0.5 mM. This is attributed to the electron-donating properties of the pyrrolidine and thiadiazole heterocyclic rings and the resonance effect of the thiadiazole ring and the inductive effect of the pyrrolidine ring, which improve the inhibitor's ability to transfer electron pairs to the unoccupied d-orbitals of the iron atoms on the mild steel surface, thereby controlling and preventing corrosion 41 . The duration of immersion also influenced the resistance of 2-TP against HCl (Fig. 2). The corrosion rate decreased over the first 10 h in 1 M HCl, reaching a maximum inhibition efficiency of 94.6%. 2-TP had the highest inhibition efficiency of 65.9% after 1 h, but after 10 h of immersion, the inhibition efficiency declined, reaching 94.8% at 0.5 mM and reducing to 88.1% after 48 h. The duration of immersion is a crucial factor in providing protection. The absorption of 2-TP molecules on the mild steel surface, which covers the area exposed to the HCl solution, is likely responsible for the decrease in corrosion rate and increase in inhibition efficiency as the 2-TP concentration increases.
2-TP has been demonstrated to be an effective corrosion inhibitor for mild steel in HCl solutions. The results showed that the inhibition efficiency increased with increasing 2-TP concentration and reached its maximum at 0.5 mM. The adsorption of 2-TP onto the mild steel surface was found to follow the Langmuir isotherm and was spontaneous and exothermic. The inhibitory effectiveness of 2-TP was compared to other nitrogen-based corrosion inhibitors for mild steel protection (Table 2) and demonstrated the highest inhibitory efficiency. 2-TP could be a promising alternative to current corrosion inhibitors, especially in industrial applications. Furthermore, 2-TP showed a stable and consistent inhibition performance in a wide range of immersion time values, temperatures, and corrosive environments. This indicates that it has a good versatility and adaptability, which is essential for industrial applications. Moreover, 2-TP has a low toxicity and environmental impact, making it a safer and more sustainable option for industrial applications compared to other nitrogen-based inhibitors 42 . To the best of our knowledge, there have been no reports of corrosion inhibitors suitable for HCl solutions. The inhibition efficiency of 0.5 mM 2-TP was found to be 94.6% at 303 K in a 1 M HCl solution, performing better than previously published inhibitors such as 2, 6, 8-12, 15-18, 20, 25, 26, 30, and 31. In the oil and gas industry, the bottom of the well is subjected to high temperatures, so a corrosion inhibitor must maintain its protective performance in corrosive media under such high temperatures.
In conclusion, the study showed that 2-TP has the potential to be a highly effective corrosion inhibitor for mild steel protection in industrial applications. Its high inhibitory efficiency, adaptability, and low toxicity make it a promising alternative to current inhibitors. Further studies should be conducted to evaluate the long-term performance and practical application of 2-TP in various industrial settings.
Effect of the temperature. The impact of temperature on the performance of inhibitors is substantial. As the temperature increases from 323 to 333 K, the inhibition efficiency remains relatively constant. However, as shown in Fig. 3, when the temperature rises from 303 to 333 K, the efficiency of the 2-TP inhibitor drops from 94.6 to 84.9% at a concentration of 0.5 mM. This decrease can be attributed to the detachment of 2-TP molecules  www.nature.com/scientificreports/ from the mild steel surface, causing a lack of protection against corrosion. As a result, the inhibition efficiency decreases as temperature increases. Temperature also has a direct impact on the rate of chemical reactions, including corrosion reactions. At higher temperatures, the rate of reaction increases, leading to a faster rate of corrosion. Inhibitors slow down the rate of corrosion by forming a protective layer on the metal surface. At higher temperatures, this layer becomes less effective as the detachment of inhibitor molecules becomes more likely, causing a decrease in inhibition efficiency 72 . Moreover, elevated temperatures can lead to thermal degradation of the inhibitor molecules, reducing their ability to protect the metal surface. This results in a decrease in the inhibition efficiency as degraded molecules can no longer provide adequate protection against corrosion 76 . the decrease in 2-TP performance at elevated temperatures could be attributed to the thermal degradation of the inhibitor molecules, which leads to the loss of the protective film formed on the metal surface. The higher temperatures could also increase the rate of corrosion, leading to a faster breakdown of the protective film formed by the inhibitor. Additionally, the Table 2. Comparison of 2-TP with other nitrogen-based corrosion inhibitors for protecting mild steel.

No
Inhibitor name Alloy Acid IE(%) References www.nature.com/scientificreports/ increased kinetic energy of the solution at higher temperatures could facilitate the adsorption of the inhibitor molecules onto other surfaces in the system, reducing the concentration of the inhibitor available to protect the metal surface.
In conclusion, temperature is a crucial factor that affects the effectiveness of inhibitors in controlling corrosion. It is important to consider the temperature conditions in which inhibitors will be used to ensure optimal performance and maximum protection against corrosion.
Adsorption isotherm. Adsorption isotherms are useful for obtaining crucial information about the adsorption of inhibitor molecules on mild steel surfaces. The surface coverage (θ) was calculated through weight loss measurements and was used to identify the most suitable isotherm. To determine if the 2-TP molecules were physically or chemically attached to the mild steel surface, various adsorption isotherms, such as Temkin, Freundlich, and Langmuir, were analyzed. The Langmuir isotherm was considered the most appropriate model as it had a linear regression coefficient close to one. The Langmuir isotherm can be expressed using Eq. 11.
where C is the inhibitor concentration and K ads , is the Langmuir constant.
The Freundlich adsorption isotherm is commonly used to describe adsorption on surfaces with varying active sites, energies, and surface heterogeneity. It defines the exponential distribution of these factors. Equation 12 represents the Freundlich adsorption isotherm.
The Temkin adsorption isotherm takes into account the indirect interactions between adsorbate molecules and the adsorption process. This is particularly important when the heat of adsorption of molecules in the layer is inversely proportional to the surface coverage. However, this model is only valid for a limited range of concentrations. Equation 13 shows the Temkin isotherm.
The isotherm and thermodynamic analyses provided sufficient information to explain the inhibition potential and adsorption mechanism of 2-TP molecules at the interface between hydrochloric acid solution and mild steel. The estimated parameters obtained from the Langmuir (Fig. 4), Freundlich (Fig. 5), and Temkin ( Fig. 6) isotherm graphs at different temperatures are presented in Table 3. The results indicate that the Langmuir isotherm model provided the best fit for the adsorption of 2-TP molecules on the surface of mild steel at all studied temperatures and times. This was confirmed by high R2 values and a slope close to unity. The Langmuir isotherm assumes that the adsorption of inhibitor molecules onto the mild steel surface is a monolayer process and that the process is energetically favorable 77 . The Langmuir constant provides valuable information about the interaction between the inhibitor molecules and the mild steel surface, as well as the mild steel surface's ability to adsorb the inhibitor molecules. Furthermore, the Langmuir isotherm can be utilized to determine the maximum adsorption capacity of the mild steel surface for the inhibitor molecules. The maximum adsorption capacity can then be used to calculate the optimal amount of inhibitor molecules needed to prevent corrosion of the mild steel surface 77 . Overall, the Langmuir isotherm provides valuable insights into the adsorption behavior of the inhibitor molecules on the mild steel surface and can guide the optimization of the inhibitor treatment process. Based on Table 3, the Langmuir isotherm was the most appropriate fit for all the temperatures tested. At 303 K, the regression coefficient (R 2 ) was calculated to be 0.999 with a computed slope value of 0.99212 ± 0.01206 and an intercept value of 0.04564 ± 0.00613. Figure 4 illustrates the Langmuir isothermal plot between C/θ and C for the temperature range of 303-333 K.    www.nature.com/scientificreports/ The relationship between the adsorbent and adsorbate is expressed by the adsorption constant ( K ads ). A higher K ads indicates improved adsorption and thus improved inhibition 78 . The relationship between the adsorption free Gibbs energy and the adsorption equilibrium constant can be represented by Eq. 14.
where T is the temperature, R is the gas constant, and 55.5 is the water content measurement. The " K ads " constant was added to the calculation above to produce the " G o ads " value. Equation (12) demonstrates that the free Gibbs energy of adsorption is proportional to the natural logarithm of the adsorption equilibrium constant, K ads . The higher the K ads , the lower the free Gibbs energy of adsorption and vice versa. In simpler terms, a low free Gibbs energy of adsorption means that the adsorbent and the adsorbate have a strong bond, leading to a high adsorption rate.
Therefore, an increase in K ads leads to a decrease in the adsorption free Gibbs energy, resulting in better adsorption and improved inhibition. Hence, K ads plays a critical role in determining the efficiency of the adsorption process and the inhibition of the adsorbate. In conclusion, the adsorption equilibrium constant, K ads , is a crucial parameter that can predict the efficiency of the adsorption process and the inhibition of the adsorbate. The relationship between K ads and the adsorption free Gibbs energy, as demonstrated by Eq. (12), emphasizes the importance of K ads in comprehending the adsorption behavior of a system 79 . A negative value of the adsorption G o ads indicates spontaneity, and the inhibitor molecules are absorbed onto mild steel. A G o ads value of ≤ − 20kJmol −1 indicates physical adsorption of the inhibitor molecule to the mild steel surface. However, a significantly negative adsorption free energy value of ≥ − 40 kJmol −1 suggests chemical adsorption, with the formation of coordination interactions between the 2-TP molecules and iron atoms on the mild steel surface. The estimated value of G o ads being − 31.4 kJmol −1 indicates a mixed-mode interaction, incorporating both physical and chemical adsorption. The calculated G o ads value indicates that the adsorption process of inhibitor molecules onto the mild steel surface is spontaneous and energetically favorable. The negative value shows that the system releases energy when the inhibitor molecules are adsorbed, leading to a decrease in the overall energy of the system. The magnitude of G o ads also reveals the type of adsorption that takes place. In physical adsorption, the process is driven by van der Waals forces, dipole-dipole interactions, and hydrogen bonding. The inhibitor molecules are attached to the mild steel surface through weak non-covalent interactions and is usually indicated by a G o ads value of less than − 20 kJmol −1 . In chemical adsorption, the process involves covalent bonding between the inhibitor molecules and the mild steel surface iron atoms. This type of adsorption is usually indicated by a G o ads value of less than − 40 kJ/mol, which represents the energy required to break the chemical bonds. The calculated G o ads value of ≥ − 31.4 kJmol −1 suggests a mixed-mode interaction between the inhibitor molecules and the mild steel surface. This indicates that both physical and chemical adsorption are taking place simultaneously, with the inhibitor molecules held to the surface through both weak non-covalent interactions and covalent bonding. Overall, the results suggest that the adsorption of inhibitor molecules onto the mild steel surface is energetically favorable and that mixed-mode interactions are occurring between the inhibitor molecules and the surface.
Thermodynamics studies. Figure 80,81 . Therefore, it was concluded that the interaction of 2-TP molecules leading to mild steel surface adsorption followed a chemical-physical mechanism. In Fig. 8, the transition state plot for the control and inhibited system after 5 h of the corrosion process is presented. The negative values of the enthalpy changes (ΔHAds) for different concentrations of 2-TP indicated (14) �G o ads = −RTln(55.5K ads )  83 . Therefore, it was concluded that the adsorption of 2-TP molecules on the mild steel surface followed a physical and chemical adsorption mechanism.
Electrochemical corrosion measurements. EIS. The frequency range used in the electrochemical impedance spectroscopy (EIS) measurements can provide important information about the system being studied. For example, the high-frequency region can provide information about the surface capacitance and doublelayer structure, while the low-frequency region can provide information about charge transfer processes and mass transport limitations. The Gamry Analyst software was used to analyze the EIS experimental data, including the calculation of CPE, R s , R ct , and C dl for mild steel in 1.0 M HCl solution 84 . Table 4 presents a comparison of the CPE of mild steel at different inhibitor concentrations at 303 K. The R ct value increases with an increasing inhibitor concentration, indicating that the corrosion inhibitors adsorb on the mild steel sample surface, forming a protective layer that slows down corrosion. At a concentration of 0.5 mM, the inhibition efficiency reached 89.39% due to the elevated R ct value. The addition of the corrosion inhibitor significantly improves the overall impedance of the mild steel sample, as illustrated in Fig. 9. The inhibition efficiency was calculated from the charge transfer resistance using Eq. (15).   85 . The larger diameter of the Nyquist plot in the presence of 2-TP signifies a higher polarization resistance, which implies a reduced corrosion rate. This is verified by the results in Table 4, which indicate that the polarization resistance (Rp) is significantly higher in the presence of 2-TP compared to 1 M HCl without 2-TP. This indicates that 2-TP has effectively inhibited the corrosion of mild steel in the test solution 86 . The electrolytic resistance (Rs) values are also higher in the presence of 2-TP, consistent with the increased polarization resistance. This elevated electrolytic resistance is caused by the formation of a protective film on the surface of mild steel, which acts as a barrier to stop the corrosion reaction 87,88 . In conclusion, the results of the EIS analysis demonstrate that the presence of 2-TP has a significant impact on the corrosion behavior of mild steel in the test solution. The 2-TP has effectively reduced the corrosion rate of mild steel by increasing the polarization resistance and forming a protective film on the surface of the metal. This demonstrates the potential of 2-TP as an effective corrosion inhibitor for mild steel in harsh environments.
Bode plots are a graphical representation of the frequency response of a system. In electrochemistry, Bode plots are commonly used to analyze the impedance behavior of a system as a function of frequency. They consist of two graphs, one showing the magnitude of the impedance (Bode modulus) and the other showing the phase shift between the applied voltage and the resulting current (Bode phase). These plots can provide valuable information about the electrochemical processes occurring at the electrode surface and the overall behavior of the system. The Bode plots illustrate that a rise in 2-TP concentration causes a broad and significant shift in the Bode modulus impedance, suggesting a slowdown in the corrosion process, as demonstrated in Fig. 10.
The interfacial interaction between 2-TP and the mild steel surface in the acidic solution plays a critical role in inhibiting the corrosion process. The adsorption of 2-TP molecules onto the mild steel surface forms a protective layer that slows down the corrosion process. The adsorption of 2-TP on the mild steel surface occurs through electrostatic interactions, such as hydrogen bonding and van der Waals forces. The presence of nitrogen and sulfur atoms in the 2-TP structure facilitates adsorption on the metal surface by forming strong coordination bonds with iron ions at the metal surface. Moreover, the two aromatic rings in the 2-TP structure provide an extensive π-conjugated system, which interacts with the surface of mild steel by π-π stacking, leading to the  www.nature.com/scientificreports/ formation of an adsorption layer. It is important to note that the adsorption of 2-TP molecules on the mild steel surface may be influenced by the pH of the solution. At low pH, the 2-TP molecules may exist in a protonated form, which can increase their affinity for the negatively charged metal surface. However, as mentioned earlier, it is difficult for 2-TP to be protonated due to the electron-withdrawing effect of the thiophene ring for the nitrogen pair of electrons and steric hindrances. The interaction between 2-TP and the mild steel surface can be studied using electrochemical impedance spectroscopy (EIS). The EIS analysis provides information on the adsorption process, the properties of the protective layer formed on the metal surface, and the corrosion rate of mild steel in the presence of 2-TP. As discussed earlier, the presence of 2-TP significantly increases the polarization resistance and electrolytic resistance of the mild steel sample, indicating the formation of a protective film on the surface of mild steel that acts as a barrier to stop the corrosion reaction. In conclusion, the interfacial interaction between 2-TP and mild steel in the acidic solution is crucial in inhibiting the corrosion process. The adsorption of 2-TP molecules on the mild steel surface occurs through electrostatic interactions, such as hydrogen bonding and van der Waals forces, as well as through coordination bonds with iron ions at the metal surface. The two aromatic rings in the 2-TP structure provide an extensive π-conjugated system, which interacts with the surface of mild steel by π-π stacking, leading to the formation of an adsorption layer. The EIS analysis provides valuable information on the adsorption process, the properties of the protective layer formed on the metal surface, and the corrosion rate of mild steel in the presence of 2-TP. The interaction between 2-TP and the steel surface can occur via multiple mechanisms. One potential mechanism is adsorption of the 2-TP molecule onto the steel surface through its aromatic rings. The thiophene ring in 2-TP are known to have π-π interactions with metal surfaces, and this can facilitate the adsorption of the inhibitor onto the steel surface. Another potential mechanism is the formation of a protective film on the steel surface via complexation between the nitrogen atom in the pyridine ring and the steel surface. This can lead to the formation of a stable complex that acts as a barrier layer between the steel and the corrosive environment, reducing the corrosion rate.
OCR. Figure 11 shows how the open-circuit potential (OCP) of mild steel in 1.0 M HCl at 303 K changes with the concentration of the 2-TP inhibitor. Inhibition in acidic media typically involves inhibitor molecules adsorbing onto the metal surface, which is often covered with oxide species. The adsorption can result in a more positive surface charge of the mild steel electrode, which is typically negatively charged, due to the presence of the positively charged 2-TP molecules. This change in the OCP suggests that a protective film is forming on the surface of the mild steel electrode.

PDP.
A potentiodynamic polarization study offers important insights into the kinetics of the reactions at the anodic and cathodic areas, as well as the inhibition action of corrosion inhibitors based on the corrosion potential 89 . Figure 12 presents polarization plots for mild steel samples in 1 M HCl with and without different concentrations of 2-TP.
Studies have shown that the presence of corrosion inhibitors can suppress the electrochemical reactions on the metal surface, resulting in a decrease in the corrosion current (icorr). This reduction in icorr indicates that corrosion is being inhibited 90 .
The results were obtained by determining the intersection of the anodic and cathodic Tafel lines of the polarization curve at E CORR . The inhibition efficiency was calculated using Eq. (16). www.nature.com/scientificreports/ From the polarization plots, it can be seen that as the concentration of 2-TP increases, the corrosion potential shifts towards more negative values, indicating a higher level of corrosion inhibition 91 . This is confirmed by the decrease in the corrosion current, which is shown by the decrease in the slope of the anodic polarization curve 92 . In fact, as can be seen from Fig. 12, both cathodic and anodic polarization curves are displaced due to 2-TP addition. This indicates that the presence of 2-TP affects both the anodic and cathodic reactions, rather than just the cathodic reaction as previously stated. Thank you for bringing this to my attention. The inhibition efficiency of 2-TP can be calculated from the polarization plots using various methods, such as Tafel slope, corrosion potential, and corrosion current density. The Tafel slope method, based on the slope of the anodic and cathodic polarization curves, provides information about the kinetics of the electrochemical reactions. A decrease in Tafel slope in the presence of 2-TP indicates a slower rate of anodic reactions, resulting in higher inhibition efficiency 93 . Similarly, the corrosion potential can also be used to determine the inhibition efficiency by comparing the corrosion potentials of mild steel samples in 1 M HCl without and with different concentrations of 2-TP. The corrosion current density, which represents the rate of corrosion, can also be used to calculate the inhibition efficiency. A decrease in the corrosion current density in the presence of 2-TP indicates a lower rate of corrosion and higher inhibition efficiency. In conclusion, the potentiodynamic polarization plots provide valuable information about the inhibition efficiency of 2-TP on mild steel in 1 M HCl. The results show that 2-TP is an effective corrosion inhibitor, and its inhibition efficiency increases with the increase in concentration. Table 5 illustrates that the addition of 2-TP resulted in a decrease in the corrosion current density (i corr ), indicating that 2-TP has an inhibitory effect on the corrosion of mild steel in the acidic solution at 303 K. This means that the addition of the inhibitor shifts the selected corrosion potentials towards more positive values, suggesting that 2-TP has an  www.nature.com/scientificreports/ inhibitory effect on the corrosion of mild steel at 303 K. The anodic and cathodic processes are altered as different amounts of 2-TP are added, as shown in Fig. 12. If the change in corrosion potential exceeds 85 mV, the inhibitor is categorized as either an anodic or cathodic type inhibitor. However, 2-TP acts as a mixed-type inhibitor, as its highest displacement of 528 mV at 303 K and a significant decrease in i corr for the inhibited system (Table 5) imply that the addition of the tested inhibitor to the acidic solution reduces the anodic solubility of mild steel and slows down the formation of cathodic hydrogen. Furthermore, the results suggest that the addition of 2-TP to the acidic solution at 303 K has a significant impact on the corrosion behavior of mild steel. The inhibitor helps to regulate the balance between the anodic and cathodic reactions, resulting in a decrease in the corrosion rate. The mixed-type inhibitor behavior of 2-TP further highlights its effectiveness in reducing corrosion, as it can target both the anodic and cathodic reactions, resulting in a reduction of both the formation of corrosion products and the hydrogen evolution reaction. This makes 2-TP a valuable tool in controlling corrosion in various applications, particularly in acidic environments. The anodic reaction during the corrosion of metals involves the dissolution of the metal, which results in the formation of metal ions and electrons. The metal ions then migrate into the electrolyte solution, leaving behind electrons that form a layer of negative charge on the metal surface. This process is referred to as oxidation. On the other hand, the cathodic reaction involves the reduction of a species from the electrolyte solution at the metal surface. This reduction reaction consumes the electrons that were released during the anodic reaction. The cathodic reaction can involve various species, such as oxygen, hydrogen ions, or water, depending on the environment in which the corrosion is taking place. In summary, the corrosion process involves both anodic and cathodic reactions that occur simultaneously and continuously, leading to the deterioration of the metal surface. 2-TP is believed to mainly inhibit anodic processes and have a lesser effect on cathodic processes. This is supported by the results of the polarization plots, which show that the cathodic polarization curve remains relatively unchanged in the presence of 2-TP, indicating that the inhibition effect is mainly due to the inhibition of anodic reactions. The inhibition efficiency of 2-TP can be calculated from the polarization plots using various methods, such as Tafel slope, corrosion potential, and corrosion current density. The Tafel slope method, based on the slope of the anodic and cathodic polarization curves, provides information about the kinetics of the electrochemical reactions. A decrease in the Tafel slope in the presence of 2-TP indicates a slower rate of anodic reactions, indicating that 2-TP mainly affects the anodic processes. However, it is important to note that 2-TP may also have some effect on cathodic processes, although this effect is likely to be less significant compared to its effect on anodic processes.
The presence of chloride ions in HCl can have an effect on the performance of 2-TP as a corrosion inhibitor. Chloride ions are known to accelerate the corrosion rate of metals, and they can also compete with the inhibitor molecules for adsorption on the metal surface. Therefore, the presence of high concentrations of chloride ions can reduce the efficiency of 2-TP as a corrosion inhibitor. However, the specific effect of chloride ions on 2-TP would depend on various factors, such as the concentration of the inhibitor and the chloride ions, the nature of the metal, and the pH of the solution.
In conclusion, the results of the study demonstrate that 2-TP has a significant inhibitory effect on the corrosion of mild steel in acidic solutions at 303 K. The inhibitor exhibits mixed-type inhibitor behavior, making it an effective solution for controlling corrosion in acidic environments. Further studies are necessary to determine the mechanism of action of 2-TP and to evaluate its performance under different conditions. Scanning electron microscope (SEM). The surface morphology of the metallic substrate strip after 5 h of exposure to hydrochloric acid solution with and without 2-TP was analyzed using SEM. The results are presented in Fig. 13a,b. In Fig. 13a, the surface of the metallic substrate exhibited severe corrosion, characterized by sagging and crown features. On the other hand, Fig. 13b shows that the addition of 2-TP to the hydrochloric acid solution resulted in a surface with significantly less corrosion compared to Fig. 13a. DFT. Calculated parameters. The Inhibition Efficiency Correlation Approach utilizes popular molecularelectronic properties to evaluate the effectiveness of inhibitor molecules. These properties include HOMO and LUMO eigenvalues, HOMO-LUMO gap, electronegativity, chemical hardness, dipole moment, Fukui indices, etc. 94,95 . The approach is based on the premise that these chemical characteristics serve as indicators for reactivity and can predict the direction of inhibitor adsorption bonding 96 . A high HOMO eigenvalue indicates high molecular electron donation, while a low LUMO eigenvalue represents high electron back-donation from surface states to the molecule. A narrow HOMO-LUMO gap means that ELUMO is larger than EHOMO 97 . Theo- www.nature.com/scientificreports/ retical chemistry methods and experimental procedures can be employed to evaluate inhibitor molecules and calculate their efficacy using quantum parameters such as atomic charge, border molecular orbitals, and energy gap. Other factors such as molecular activity, chemical structure, and corrosion inhibitor capacity must also be taken into account 98,99 . The behavior of inhibitors can be understood through their optimal chemical structures and electrochemical behavior in the presence of orbital energies and differences. Frontier molecular orbitals, softness, and hardness are related to the potential of the inhibitor for interaction 100 . Computational chemistry research has been used to determine the efficacy of protection and molecular orbital energy levels of organic compounds 84 . Density Function Theory (DFT), which calculates a molecule's total electron energy based on electron density, has been utilized to study the inhibitory behavior of various sets of corrosion inhibitors. The electronic characteristics were computed and are presented in Table 6. The 2-TP inhibition efficacy is linked to the electron-donating potential of EHOMO. By increasing the value of HOMO, the 2-TP inhibition efficacy is also increased. This is because the transfer of charge along the metal surface and initiation of the adsorption mechanism rely on this mechanism. As shown in Fig. 14, the assessed 2-TP is considered to have the greatest inhibitory effectiveness, as it has the highest energy value of HOMO. This high value of HOMO results in a high level of inhibitory effectiveness. The efficacy of electron reception is crucial for ELUMO. A low ELUMO value indicates that inhibitor molecules can find another negative charge on the mild steel surface. The 2-TP molecules have a high LUMO and EHOMO value, indicating their reactiveness as a donor. However, 2-TP molecules with a small EHOMO value decrease metal reactivity and inhibit efficiency 84 .
The 2-TP molecules with the most effective corrosion inhibition, as determined by the EHOMO-ELUMO value, have high softness, low hardness, and a low energy gap. Electronegativity (χ) is also an important factor in inhibiting potency. The inhibiting effects of 2-TP as an iron-inhibitor were studied, revealing that the iron atoms form chemical bonds by gaining electrons from the inhibitor molecules 101 . 2-TP is effective with a low electronegativity value, as indicated by the ΔN value, which shows that the 2-TP molecules transfer more electrons to the iron atoms on the metal surface. Dipole moment (μ) is another factor that may indicate inhibitory efficiency, but previous studies have not shown a significant correlation. The inhibitory efficiency of 2-TP, with a low dipole moment value, suggests a strong coating on the metal surface.
In conclusion, the inhibitory efficiency of 2-TP molecules depends on several factors including the EHOMO-ELUMO value, electronegativity, and dipole moment. 2-TP molecules with a high EHOMO value and low energy gap are highly effective inhibitors due to their softness and low hardness values 102 . Additionally, 2-TP molecules  www.nature.com/scientificreports/ with low electronegativity values provide better performance as they transfer more electrons to the iron atoms on the metal surface. Lastly, 2-TP molecules with a low dipole moment value are believed to provide a stronger coating on the metal surface, contributing to the inhibitory efficiency. These findings provide valuable insights into the development of effective inhibitors for mild steel corrosion protection.
Mulliken charges. The Mulliken atomic charges of the 2-TP are shown in Fig. 15. The Mulliken charges method is a widely used method to predict the connections between adsorption sites. The heteroatoms in the inhibitor molecules enhance the adsorption ability by donating and accepting electrons. The efficacy of the 2-TP is attributed to the sulfur and nitrogen atoms in the inhibitor molecules 103,104 . As shown in Fig. 15, the 2-TP molecules bond coordinately with the d-orbitals of the iron atoms on the mild steel surface through nitrogen atoms N(3), N(4), and N(6). This leads to the formation of strong coordination bonds between the 2-TP molecules and the mild steel surface, thereby enhancing the corrosion protection provided by the inhibitor. Additionally, the sulfur atom (S(1)) in the 2-TP molecule also contributes to the adsorption process by providing additional electrondonating capacity. The overall charge distribution of the 2-TP molecule also indicates that it is a polar molecule, which enables it to form hydrogen bonds with the mild steel surface, further strengthening the adsorption. In conclusion, the Mulliken atomic charges of the 2-TP molecule offer valuable insights into its adsorption mechanism and effectiveness as a corrosion inhibitor for mild steel surfaces.
Suggested mechanism. The efficiency of corrosion protection on mild steel in acidic conditions can be evaluated based on the molecular structure of the inhibitor and its interaction with the iron atoms on the metal surface. The effectiveness of the inhibitor is influenced by the type of bond formed between the inhibitor and the metal surface (chemisorption) and the number of adsorption sites available. In the case of the 2-TP molecule, all nitrogen atoms serve as adsorption sites and can form coordination bonds with the mild steel surface through the use of unpaired electrons. The nitrogen atoms can also be protonated through physisorption with chloride ions 105 . The presence of unpaired electrons and the inductive effect of the sulfur atom are key factors contributing to the high inhibitive potency of 2-TP. Figure 16 provides a visual representation of the adsorption process of 2-TP molecules on the steel/HCl interface. The free electrons of the nitrogen atoms are transferred to the d-orbitals of the iron atoms, effectively blocking the corrosion process. This forms a complex with the inhibitor molecule and the iron atom. The adsorption of 2-TP molecules onto the mild steel surface forms a layer of protection, which prevents further corrosion of the metal. This protective layer also slows down the reaction rate of the mild steel and HCl, as the 2-TP molecules act as a barrier between the two. The 2-TP molecule also has a positive effect on the mild steel surface by reducing the electrochemical  www.nature.com/scientificreports/ potential and lowering the corrosive potential. This happens as the adsorption of 2-TP molecules increases the pH of the surrounding environment and thus reduces the concentration of H + ions 106 .
In conclusion, the inhibitor molecule 2-TP exhibits high inhibitive efficiency in protecting mild steel from corrosion in an acidic environment. The molecular structure of the inhibitor and its interaction with the iron atoms of the mild steel surface play a crucial role in the inhibitive efficiency. The 2-TP molecules form a protective layer on the mild steel surface, reducing the reaction rate and lowering the corrosive potential.

Conclusion
In conclusion, the study demonstrated that 2-(1,3,4-thiadiazole-2-yl)pyrrolidine (2-TP) is an effective inhibitor for mild steel corrosion in 1 M HCl solution. The results from weight loss, potentiodynamic polarization, and electrochemical impedance spectroscopy (EIS) showed that 2-TP adsorbed onto the mild steel surface and formed a protective layer, leading to a reduction in the corrosion rate and increased inhibition efficiency. The study also indicated that temperature had a significant impact on the performance of the inhibitor, with higher temperatures leading to a decrease in inhibition efficiency. The EIS results showed that the presence of 2-TP had a significant impact on the corrosion behavior of mild steel by increasing the polarization resistance and forming a protective film on the metal surface. The potentiodynamic polarization plots showed that the concentration of 2-TP had a significant impact on the corrosion potential and corrosion current, resulting in higher inhibition efficiency. The study highlights the potential of 2-TP as an effective corrosion inhibitor for mild steel in harsh environments.

Data availability
The datasets used and/or analysed during the current study available from the corresponding author on reasonable request. www.nature.com/scientificreports/